import axios from "axios";
import useBaseStore from "@/stores/baseStore.ts";



const api = axios.create({
	baseURL: '/api',
});
// 添加请求拦截器
api.interceptors.request.use(
	(config) => {
		const baseStore = useBaseStore();
		config.headers['token'] = baseStore.getToken;
		return config;
	},
	(error) => {
		return Promise.reject(error);
	}
);

const fileApi = axios.create({
	baseURL: '/fileApi',
});

export { api, fileApi }